package com.corpcredit.dao.util;

import org.hibernate.SessionFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate3.HibernateTemplate;

public class HibernateTemplateFactory {

    private static HibernateTemplate hibernateTemplate;
    
    static {
        ApplicationContext ctx = ApplicationContextFactory.getApplicationContext();
        SessionFactory sessionFactory = (SessionFactory) ctx.getBean("sessionFactory");
        hibernateTemplate = new HibernateTemplate( sessionFactory );
        
    }

    public static HibernateTemplate getHibernateTemplate() {
        return hibernateTemplate;
    }
}
